import 'package:dio/dio.dart';
import 'package:pretty_dio_logger/pretty_dio_logger.dart';

class NetworkModule {

  static final NetworkModule _module = NetworkModule._internal();

  factory NetworkModule() => _module;

  late final Dio dio;


  NetworkModule._internal(){
    var options = BaseOptions(
        baseUrl: "https://www.wanandroid.com/",
        connectTimeout: Duration(seconds: 5),
        receiveTimeout: Duration(seconds: 5)
    );

    dio = Dio(options);
    //添加日志
    // dio.interceptors.add(LogInterceptor());
    dio.interceptors.add(PrettyDioLogger());
  }

}